<?php
session_start();
if(empty($_SESSION["id"])) header("Location:index.php");
include("/inc/producto.class.php");

		if(isset($_GET['cat'])){
			if($_GET['cat'] == 1) $categoria = 'Apuntes';
			else if($_GET['cat'] == 2) $categoria = 'Libros';
			else if($_GET['cat'] == 3) $categoria = 'Otros';
		}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<!--  Version: Multiflex-3 Update-7 / Layout-1             -->
<!--  Date:    January 15, 2007                            -->
<!--  Author:  Wolfgang                                    -->
<!--  License: Fully open source without restrictions.     -->
<!--           Please keep footer credits with a link to   -->
<!--           Wolfgang (www.1-2-3-4.info). Thank you!     -->

<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout1_setup.css" />
  <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout1_text.css" />
  
    <link rel="stylesheet" href="css/galleriffic-2.css" type="text/css" />
		<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
		<script type="text/javascript" src="js/jquery.galleriffic.js"></script>
		<script type="text/javascript" src="js/jquery.opacityrollover.js"></script>
		<!-- We only want the thunbnails to display when javascript is disabled -->
		<script type="text/javascript">
			document.write('<style>.noscript { display: none; }</style>');
		</script>
  <title>GiveAway</title>
</head>

<!-- Global IE fix to avoid layout crash when single word size wider than column width -->
<!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]-->

<body>
  <!-- Main Page Container -->
  <div class="page-container">

   <!-- For alternative headers START PASTE here -->

    <!-- A. HEADER -->      
    <div class="header">
      
      <!-- A.1 HEADER TOP -->
      <div class="header-top">
        
        <!-- Sitelogo and sitename -->
        <a class="sitelogo" href="index.php" title="home"></a>
        <div class="sitename">
          <h1><a href="index2.php" title="Home">GiveAway</a></h1>
        </div>
        <!-- Navigation Level 1 -->
        <div class="nav1">
          <ul>
            <li><a href="index2.php">Home</a></li>
            <li><a href="contacto.php">Cont&aacute;ctanos</a></li>
          </ul>
        </div>              
      </div>
      
      <!-- A.2 HEADER MIDDLE -->
      <div class="header-middle">    
   
        <!-- Site message -->
        <div class="sitemessage">
          <h1>COMPARTE</h1>
          <h2>Intercambio y donación de productos</h2>
          <h3><a href="#">&rsaquo;&rsaquo;&nbsp;M&aacute;s detalles</a></h3>
        </div>         
      </div>
      
      <!-- A.3 HEADER BOTTOM -->
      <div class="header-bottom">
      
        <!-- Navigation Level 2 (Drop-down menus) -->
        <div class="nav2">
	
          <!-- Navigation item -->
          <ul>
            <li><a href="index2.php">Home</a></li>
          </ul>
          
          <!-- Navigation item -->
          <ul>
            <li><a href="productos.php">Mis Productos</a></li>
          </ul>          

          <!-- Navigation item -->
          <ul>
            <li><a href="navegar.php">Productos Disponibles</a></li>
          </ul>
		<ul>
            <li><a href="perfil.php">Configuraci&oacute;n</a></li>
          </ul>
		  <ul>
            <li><a href="logout.php">Salir</a></li>
          </ul>
        </div>
	  </div>

      <!-- A.4 HEADER BREADCRUMBS -->

      <!-- Breadcrumbs -->
      <div class="header-breadcrumbs">
      </div>
    </div>

   <!-- For alternative headers END PASTE here -->

    <!-- B. MAIN -->
    <div class="main">
  
      <!-- B.1 MAIN CONTENT -->
      <div class="main-content">
        
        <!-- Pagetitle -->
        <h1 class="pagetitle">Productos en la categor&iacute;a <?php echo $categoria; ?></h1>

        <!-- Content unit - One column -->
        <div class="column1-unit">
		
				  		<div id="page">
			<div id="container">

				<!-- Start Advanced Gallery Html Containers -->
				<div id="gallery" class="content">
					<div id="controls" class="controls"></div>
					<div class="slideshow-container">
						<div id="loading" class="loader"></div>
						<div id="slideshow" class="slideshow"></div>
					</div>
					<div id="caption" class="caption-container"></div>
				</div>
				<div id="thumbs" class="navigation">
					<ul class="thumbs noscript">
						<?php
							$p = new producto();
							$productos = $p->BuscaCategoria($_GET['cat']);
							while($row = mysql_fetch_array($productos)){
								echo '<li>
							<a class="thumb" name="bigleaf" href="imgs/'.$row['producto_imagen'].'" title="'.$row['producto_nombre'].'">
								<img height="80px" width="80px" src="imgs/'.$row['producto_imagen'].'" alt="'.$row['producto_nombre'].'" />
							</a>
							<div class="caption">
								<div class="download">
									<a href="detalle.php?pid='.$row['producto_id'].'">Mas Detalles</a>
								</div>
								<div class="image-title">'.$row['producto_nombre'].'</div>
								<div class="image-desc">'.$row['producto_descripcion'].'</div>
							</div>
						</li>
								';
							}					
						?>
					</ul>
				</div>
				<div style="clear: both;"></div>
			</div>
		</div>
         
        </div>          
        <hr class="clear-contentunit" />
     
      </div>
    </div>
      
    <!-- C. FOOTER AREA -->      

    <div class="footer">
      <p>Copyright &copy; 2011 GiveAway | All Rights Reserved</p>
      <p class="credits">Design by <a href="http://www.1-2-3-4.info/" title="Designer Homepage">Wolfgang</a></p>
    </div>      
  </div> 
  		<script type="text/javascript">
			jQuery(document).ready(function($) {
				// We only want these styles applied when javascript is enabled
				$('div.navigation').css({'width' : '300px', 'float' : 'left'});
				$('div.content').css('display', 'block');

				// Initially set opacity on thumbs and add
				// additional styling for hover effect on thumbs
				var onMouseOutOpacity = 0.67;
				$('#thumbs ul.thumbs li').opacityrollover({
					mouseOutOpacity:   onMouseOutOpacity,
					mouseOverOpacity:  1.0,
					fadeSpeed:         'fast',
					exemptionSelector: '.selected'
				});
				
				// Initialize Advanced Galleriffic Gallery
				var gallery = $('#thumbs').galleriffic({
					delay:                     2500,
					numThumbs:                 15,
					preloadAhead:              10,
					enableTopPager:            true,
					enableBottomPager:         true,
					maxPagesToShow:            7,
					imageContainerSel:         '#slideshow',
					controlsContainerSel:      '#controls',
					captionContainerSel:       '#caption',
					loadingContainerSel:       '#loading',
					renderSSControls:          true,
					renderNavControls:         true,
					playLinkText:              'Play Slideshow',
					pauseLinkText:             'Pause Slideshow',
					prevLinkText:              '&lsaquo; Previous Photo',
					nextLinkText:              'Next Photo &rsaquo;',
					nextPageLinkText:          'Next &rsaquo;',
					prevPageLinkText:          '&lsaquo; Prev',
					enableHistory:             false,
					autoStart:                 false,
					syncTransitions:           true,
					defaultTransitionDuration: 900,
					onSlideChange:             function(prevIndex, nextIndex) {
						// 'this' refers to the gallery, which is an extension of $('#thumbs')
						this.find('ul.thumbs').children()
							.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
							.eq(nextIndex).fadeTo('fast', 1.0);
					},
					onPageTransitionOut:       function(callback) {
						this.fadeTo('fast', 0.0, callback);
					},
					onPageTransitionIn:        function() {
						this.fadeTo('fast', 1.0);
					}
				});
			});
		</script>
</body>
</html>



